﻿using HBKY.Shop.Model;
using System.Threading.Tasks;
namespace HBKY.Shop.Tasks
{
    /// <summary>
    /// 任务调度管理中心
    /// </summary>
    public interface ISchedulerCenter
    {
        /// <summary>
        /// 开启任务调度
        /// </summary>
        /// <returns></returns>
        Task<bool> StartScheduleAsync();

        /// <summary>
        /// 停止任务调度
        /// </summary>
        /// <returns></returns>
        Task<bool> StopScheduleAsync();

        /// <summary>
        /// 添加一个计划任务
        /// </summary>
        /// <param name="sysSchedule"></param>
        /// <returns></returns>
        Task<bool> AddScheduleJobAsync(TaskJobListDto taskJobViewModel);

        /// <summary>
        /// 停止一个任务
        /// </summary>
        /// <param name="sysSchedule"></param>
        /// <returns></returns>
        Task<bool> StopScheduleJobAsync(TaskJobListDto taskJobViewModel);

        /// <summary>
        /// 恢复一个任务
        /// </summary>
        /// <param name="sysSchedule"></param>
        /// <returns></returns>
        Task<bool> ResumeJob(TaskJobListDto taskJobViewModel);

    }
}
